import request from '../utils/requets.js'
import uploadFile from '../utils/uploadFile.js'

const api = {}

// GET请求
api.get = (path, params, header) => request(path, 'GET', params, header)

// POST请求
api.post = (path, data, header) => request(path, 'POST', data, header)

// PUT请求
api.put = (path, data, header) => request(path, 'PUT', data, header)

// DELETE请求
api.delete = (path, data, header) => request(path, 'DELETE', data, header)

// 上传文件
api.uploadFile = (path, data, header) => uploadFile(path, data, header)

export default api